<?php

namespace App\Http\Controllers\App;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class BaseController extends Controller
{
    public $pageSize = 10; //默认分页大小

    public $shop_id = '1'; //店铺ID
    /**
     * 验证是否登录
     *
     * @param [type] $method
     * @param [type] $parameters
     * @return void
     */
    public function callAction($method, $parameters)
    {
        $shopInfo = session('shopInfo');

        $shopid   = $shopInfo['id'];
        if ( empty($shopid)) {
             return self::error('请先登录', 2);
        }
        $this->shop_id = $shopid;  



        //测试默认店铺ID
/*        session(['shopInfo' => ['id' => 1]]); //测试默认店铺ID  -- 正式上线需删除

        $this->shop_id  = 1;*/


        
        return call_user_func_array([$this, $method], $parameters);
    }

    
}
